Fixing the syd exit function