Fix bug retrieving data