added error check to setjoints input