Update clock.py

fixes for various issues when a clock is deleted