Make the scripts in query work