fixed a few bugs and issues