handling priority for applications