fixed all bugs on Mac