fixed some bugs on some places