Add success condition and remove break