fixed animate and focus functions