check boundaries