updated code for better support bubble position