added require fs to fix bug