Fixed process but funtion remains stuck in closure