fixed CRUD functions