add alignment checking