bug fixes for loading