Problem might be with deref not working