Fix query and require