Fix syntax error and add correct return value