Code to Register an application(Issues Fixed)