Adjusted logic in updateq's for processing waitq