calculating max length for range input
added stop method