bug fixes related to previous commit