trying to fix abort() error by re-writing find()