added additional input validation in model to prevent SQL query borkage on empty input.