cleaned up; fixed bad deref