fixing data retrieval