Testing function and extra if condition