working version for aws