fixing bug in top_map