fixed the not storing data bug