bugfixing and add time utility