Updated to fix some timing issues