fixing null problem