Checks for valid length