fixed encoding and param errors