Modified base on Mantis 1.2.15