transferring data between two states working