bugfix: memleak uses funcion raw, but it was deleted at some point -- reimplemented it