bad coding and bad osx fix