added null checks to post and init registration scripts