added loop instead of timer