 		db.on 'error', (err) ->
 			@logger.logError @currentModule, err
 			try
-				mongoose.connection.close()
+				mongoose.disconnect()
+				#mongoose.connection.close()
 				callback err
 			catch error
 				@logger.logError @currentModule, error


		#filepost = post.save _
		post.addFile files.uploadedFile, opts, _
		mongoose.connection.close()

		post


		Post = @initDB _
		post = new Post()
		post.getFile id, _
		mongoose.connection.close()

	deleteFile: (id, _) =>
		@logger.logDebug @currentModule, "deleteFile #{id}"
		Post = @initDB _
		post = new Post()
		post.deleteFile id, _
		mongoose.connection.close()