fixes nil exception