fixed issue #2595 #2563 #2511