check pre and post conditions