improving null checks
should prevent hack copies of gems