fix loader
added tests