applied a fix to #608 and #588

#608 might cause some problems to the animations for the avatar coming
in/out