updated to work with mavericks