updated code... for map loading