Added range check to laitepinta