bug fixes relating to last commit