Made changes. It seems to work fine.