fix processing bugs