added setimmediate
fix permission