updated to work with exiting values