Fixed and issue with advanced select statements not working