adding check if user can edit