replace index 0 with index 1 and return statement

Ref #743