fix logic to work with position field