fix for BYTEMAN-230 courtesy of Richard Opalka