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

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

		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()