Fixing the spy config to work better

Made changes that keep main function, but improve stability