bug fixes for file