testing if the function is executed right away