Try to send 500 Internal error when exception reachs this point
Better use append rather than copy here.
Removed wsf_support, which is useless and unused
Cosmetic, improve readability of conditions