fixed some bugs and values