added helper fork function