added little bit of priority check