bugfix: decode function