fixed permission + bug-fixes

note: still a little unstable