fix dashboard function