started adding scale detection