fixing a few more bugs