Added validation for pdf