Fixes null pointer