handling null pointer exception in lab solver