fixing #507