Updated

Added range check