treating data on query