fixing bug, return statement was missing