Removed limit and checking for table
Close connection when done