edited the mysql create function due to a mysql table change because of the new unseen count