processQueue function is updated with real function calling