Fix for bad retrieving data and create initial state