Added persmission check