refactored wrong integer parsing