added timer, may not work correctly yet