Use return value instead of error variable for condition
Changed constant prefix to use the app namespace