Fixed some scope issue and took out an extra comma