fixing a bug that @farzinfadamin caused with his pull request.