added support of None weights