Removed jQuery dependency, added timeout handlers