Added $previousState service
Switched from remember to memo function name