in reply to uninitialized value

you have to make sure that param('btn') returns a defined value, which, according to the error message, currently isn't the case.