Hopefully fixed a null pointer exception that would be thrown by the system