Fix setTimout firing multiple times