add Licence and fix return value