Fixes a bug when fn is not defined