fixed null pointer for on resume