changed max to 27 + null check