updated for Mavericks