fixed null pointer error (I hope)