fix form (show map and grid map at first) algorithm