fix an error 500 for this ajax handler

Fixes #53