added return in error case