some bugs and fixings