added hasElement + fix in parser