fix title display for unnamed maps
move script into head in layout