fix the blocking logic in put and take. thanks to Jameson.