fix #604

This is not perfect, but will do until the back-end is re-vamped