Removed a null pointer exception