Fixed a bug with applications