Return promise when registering query