fixed bug that stopped it running in mavericks