Cleaned up and fix problem where failed to register time listener