refactored, one inout field, strange exception occures