Fixed a bug with 'file' event not firing