undefined exeption fix