Adding loader logic