Load function improved