Used function instead of global