added a simple func to decode ids