Fixed some bug while drawing rect in map