corrections to includes and sql queries