fixed mac os x bugs