Fixed a bug with button visibility