bug fixes

fixed some bugs