fixed some bugs on perspective