fixed the null problem