Fixes a null pointer error