Added return code, via answer from StackOverflow