added queries for isvalidmovieid and isvalidplanid