add beforeCreate function;