added button logic