fixed EMV building
code rearrange