move fix permissions at the end