updated switch with another if block within updateadditional checking on update and patch