adds method to add value in case it doesn't exist