move fork inside of trycatch