added case statements for error handling
added max file size for input