Fixed if and function calling