Fixes return in case of an exception