First attempt to fix NullPointerException