merged change by danmana and pdkovacs