bugfix temp else null in factory