fixed bug in joomla 2.5 and joomla 3.1