fixing issues from last PR