Potential fix to setTimeout