Code improvments

validating that variables cannot be empty