added switch case for handling updates;