fixed bugs in accepting existing values