fixed fatal bug of alignment()