added return statement into non-void function