fixing malformed erros