Python3 compatibility
maybe fix the dropped key issue