Added minor check to function calls