added input length limits