solution that seems to work sometimes