added changes to edit function resolves issue #18