Fixed nullpointer bug!