changes based on mashhoodr pull request

Signed-off-by: Markus Jura <markus.jura@googlemail.com>