added created functionality and changed update