AND, may I ask what you use in the left hand this passage?I think a part of the problem is there as well.
The E octave can be staccato. Start from G#, 5321 321 321 then use #2 & 5 for A# and E. You can even connect B to A# and E with this fingering.Are you studying this sonata by yourself?