call mapper inside handler to avoid segfaults

call mapper inside handler to avoid segfaults