Fixed http://sunflower.sahanafoundation.org/eden/project/task/169

Fixed http://sunflower.sahanafoundation.org/eden/project/task/169. @somayjain , please verify