added logic for updating an account