bug fixes for last commit