add loader functionality