Fixing break and return in script