Added error checks and app name validation