added dynamic logic
added dynamic logic