Implemented changes in issue 149