fixed 'function ends without a return statement' warning