fixed envelope validity check