changed setInterval to setTimeout and set to 500ms