src: added missing permission, bugs fixed