fixed profile bug and structuring the application better