handle the problem reported in mantis 3611 & 3615