Fix for setInterval and setTimeout