add some utility functions