made plugin more dynamic