add function to check queue