null checks in handleClick for dealing with missing positions