fixed bad access issues