changed application key logic