Issue509

fixes #509