Fixes crash issues when registering