Separate SQL and add Progress Bar