added timeout to loader function in controller