hook for processing results