added fix for encoding