If/else return functionf fix