Add loader logic