fix type handling