fixing some bugs and issues