fixed issues with dynamic calendar creation