Add validation and fix loading map