hiding buttons accordingly