Fix for ticket id #1487

link - http://eden.sahanafoundation.org/ticket/1487