implement error checking on position