fixed "wrong flag" error

Closes #438