Prevent query is executed 2 times