Made clock.py more robust