updated create invoice method