Fixed a nullpointererror