added event creating to model.js