got both function to work