Fixed null pointer expection