remove useless lines and add permissions