closed #1007 closed #1010 closed #1046