masking changes to conform to rfc
added fail conditions as per rfc