Check for valid bounds before using it