fix processing order