Did you test this? `return` is actually a call to an internal function in R, so you must do `return()` or it won't do anything.