updating scope with $id