bug fixes for delay