fix for issue 301. 

had to delete last pull request and create a new one because i needed to rollback some other commits until one was merged.