Feature/fix dereference bug