Added basic height detection back due to performance issues