modified code sign entitements logic