Check variable and execute function with it.