timer only alerts when button is pushed on second page