Fixed bug when returning data