bug fixes for modes