fixed obvious bug, redmine issue #539