added button pressed behaviour