Handling multiple instances in get_val and set_val