Fixed issue with Javascript validation