* fix bug about wrong dependencies permissions check and other wrong permissions check * improve code