Fixed Event queue bug

Updated to flush queue when no events available