Got loading functionality to work