fix return bugs and add transparency