Fix some errors on sitekey check and throw error