fix for ticket #3 , might not be future proof