Fix undefined when loading application