some helper functions for queue module