fix pinmode setting