working empcreatefunc