Fixed null pointer exception in debug