correctly encode and decode id of a folder