Added safety for empty functions