Modified genre sql to properly fetch genres and counts