fixing undefined and button name