Added error handling to lamp_control.py