Fix: Crash due to null pointer