queue put implementation