routes definition moved up because it used by dashboard function