Fix for NullPointerException