bug fixes for more errors