cleaning up a few bugs