implemented loading functionality