Return value wasn't functioning correctly