Fix bug from empty function