added encoding flag