added same changes as in master

@bcordis As you suggested i just added the same changes to development branch. I can't test it without a running installation, so please test it.