changed permissions and fixex a bug