fix significant bug
modify things to avoid error
fix permissions issue