This fixes the NullPointerException crash.