sorted out silly encoding handling