add states and lamp handles logic