bug fixes in last commit