refactor code in exception controller
Fix an issue in sidebar flash animation