fixing a few bugs and issues